package com.whw.fy.utils;

import cn.hutool.core.io.FileUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;

import java.util.HashMap;
import java.util.List;

public class ExcelReadUtil {

    public static  List<List<Object>> getExcelData(String fileUrl){

        ExcelReader reader = ExcelUtil.getReader(FileUtil.file(fileUrl));
        List<List<Object>> readAll = reader.read();
        return readAll;
    }

    public static List<List<Object>> getExcelDataBySheet(String fileUrl,String sheet){

        ExcelReader reader = ExcelUtil.getReader(FileUtil.file(fileUrl),sheet);
        List<List<Object>> readAll = reader.read();
        System.out.println(readAll);
        return readAll;
    }

}
